home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.3 / LinkVar.3 < prev    next >
Encoding:
Text File  |  1995-07-26  |  6.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr((((3333))))              TTTTccccllll ((((7777....0000))))              TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr((((3333))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           Tcl_LinkVar, Tcl_UnlinkVar - link Tcl variable to C variable
  12.  
  13.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.           ####iiiinnnncccclllluuuuddddeeee <<<<ttttccccllll....hhhh>>>>
  15.  
  16.           int
  17.           TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr(_i_n_t_e_r_p, _v_a_r_N_a_m_e, _a_d_d_r, _t_y_p_e)
  18.  
  19.           TTTTccccllll____UUUUnnnnlllliiiinnnnkkkkVVVVaaaarrrr(_i_n_t_e_r_p, _v_a_r_N_a_m_e)
  20.  
  21.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  22.           Tcl_Interp   *_i_n_t_e_r_p    (in)      Interpreter that  contains
  23.                                             _v_a_r_N_a_m_e.    Also  used  by
  24.                                             TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr   to    return
  25.                                             error messages.
  26.  
  27.           char         *_v_a_r_N_a_m_e   (in)      Name of global variable.
  28.  
  29.           char         *_a_d_d_r      (in)      Address of C variable that
  30.                                             is   to   be   linked   to
  31.                                             _v_a_r_N_a_m_e.
  32.  
  33.           int          _t_y_p_e       (in)      Type of C variable.  Must
  34.                                             be one of TCL_LINK_INT,
  35.                                             TCL_LINK_DOUBLE,
  36.                                             TCL_LINK_BOOLEAN, or
  37.                                             TCL_LINK_STRING,
  38.                                             optionally OR'ed with
  39.                                             TCL_LINK_READ_ONLY to make
  40.                                             Tcl variable read-only.
  41.      _________________________________________________________________
  42.  
  43.  
  44.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  45.           TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr uses variable traces to keep  the  Tcl  variable
  46.           named  by _v_a_r_N_a_m_e in sync with the C variable at the address
  47.           given by _a_d_d_r.  Whenever the Tcl variable is read the  value
  48.           of  the  C  variable  will be returned, and whenever the Tcl
  49.           variable is written the C variable will be updated  to  have
  50.           the same value.  TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr normally returns TCL_OK;  if an
  51.           error occurs while setting up the link (e.g. because _v_a_r_N_a_m_e
  52.           is  the  name  of  array)  then  TCL_ERROR  is  returned and
  53.           _i_n_t_e_r_p->_r_e_s_u_l_t contains an error message.
  54.  
  55.           The _t_y_p_e argument specifies the type of the C variable,  and
  56.           must have one of the following values, optionally OR'ed with
  57.           TCL_LINK_READ_ONLY:
  58.  
  59.           TTTTCCCCLLLL____LLLLIIIINNNNKKKK____IIIINNNNTTTT
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/10/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr((((3333))))              TTTTccccllll ((((7777....0000))))              TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr((((3333))))
  71.  
  72.  
  73.  
  74.                The C variable is of type iiiinnnntttt.  Any value written  into
  75.                the  Tcl  variable  must  have  a  proper  integer form
  76.                acceptable  to  TTTTccccllll____GGGGeeeettttIIIInnnntttt;   attempts  to  write  non-
  77.                integer  values  into _v_a_r_N_a_m_e will be rejected with Tcl
  78.                errors.
  79.  
  80.           TTTTCCCCLLLL____LLLLIIIINNNNKKKK____DDDDOOOOUUUUBBBBLLLLEEEE
  81.                The C variable is of type ddddoooouuuubbbblllleeee.   Any  value  written
  82.                into  the  Tcl  variable  must  have a proper real form
  83.                acceptable to TTTTccccllll____GGGGeeeettttDDDDoooouuuubbbblllleeee;  attempts  to  write  non-
  84.                real  values  into  _v_a_r_N_a_m_e  will  be rejected with Tcl
  85.                errors.
  86.  
  87.           TTTTCCCCLLLL____LLLLIIIINNNNKKKK____BBBBOOOOOOOOLLLLEEEEAAAANNNN
  88.                The C variable is of type iiiinnnntttt.  If its  value  is  zero
  89.                then  it will read from Tcl as ``0''; otherwise it will
  90.                read from Tcl as ``1''.  Whenver _v_a_r_N_a_m_e  is  modified,
  91.                the  C  variable  will  be  set to a 0 or 1 value.  Any
  92.                value written into the Tcl variable must have a  proper
  93.                boolean form acceptable to TTTTccccllll____GGGGeeeettttBBBBoooooooolllleeeeaaaannnn;  attempts to
  94.                write non-boolean values into _v_a_r_N_a_m_e will be  rejected
  95.                with Tcl errors.
  96.  
  97.           TTTTCCCCLLLL____LLLLIIIINNNNKKKK____SSSSTTTTRRRRIIIINNNNGGGG
  98.                The C variable is of type cccchhhhaaaarrrr ****.  If its value is  not
  99.                null  then  it  must be a pointer to a string allocated
  100.                with mmmmaaaalllllllloooocccc.  Whenever the Tcl variable is modified the
  101.                current  C  string will be freed and new memory will be
  102.                allocated to hold a copy of the variable's  new  value.
  103.                If  the C variable contains a null pointer then the Tcl
  104.                variable will read as ``NULL''.
  105.  
  106.           If the TCL_LINK_READ_ONLY flag is present in _t_y_p_e  then  the
  107.           variable  will  be read-only from Tcl, so that its value can
  108.           only be changed by modifying the C  variable.   Attempts  to
  109.           write the variable from Tcl will be rejected with errors.
  110.  
  111.  
  112.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  113.           boolean, integer, link, read-only, real, string, variable
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/10/95)
  130.  
  131.  
  132.  
  133.